Skip to content

fix: clean up docker process in DownloadContainerLogs on timeout#12607

Open
wayne0926 wants to merge 1 commit into1Panel-dev:dev-v2from
wayne0926:fix/download-container-logs-leak
Open

fix: clean up docker process in DownloadContainerLogs on timeout#12607
wayne0926 wants to merge 1 commit into1Panel-dev:dev-v2from
wayne0926:fix/download-container-logs-leak

Conversation

@wayne0926
Copy link
Copy Markdown

@wayne0926 wayne0926 commented Apr 26, 2026

DownloadContainerLogs starts a docker logs child process but never
kills it when the 3-second read timeout fires. The function returns, the
HTTP response is sent, and the child process is reparented to PID 1.

On servers with many containers or large log files the timeout is easy to
hit, so these orphans accumulate over time.

This patch:

  • adds a defer that kills and reaps the child process on every exit path
  • removes two Process.Signal() calls that ran before Start(), which
    would panic on the nil Process pointer
fix: clean up docker process in DownloadContainerLogs on timeout

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 26, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zhengkunwang223 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant